export default (ref) => {
	let validateForm = ref;
    // 循环规则
    for(let key in validateForm.rules){
    	let currentItemList = validateForm.$children.filter(child => child['prop'] === key);
    	if(currentItemList.length === 0){
    		continue;
    	}

    	// 获取当前正在验证的form
    	let currentItem = currentItemList[0];
    	// 判断是否为input或textarea且非select(部分select的value为数字)
    	let isInput = currentItem.$el.getElementsByClassName('el-input__inner').length > 0;
    	let isTextarea = currentItem.$el.getElementsByClassName('el-textarea__inner').length > 0;
    	let isNotSelect = currentItem.$el.getElementsByClassName('el-select').length === 0;
    	
    	if((isInput || isTextarea) && isNotSelect){
    		let ruleList = validateForm.rules[key];
    		ruleList.map( single => {
    			// 如果是非空验证，则添加验证空格
    			if(single.required){
    			  single['pattern'] = '[^ \x22]+';
    			}
    		})
    	}
    }
}